<?php

$this->pageTitle=Yii::app()->name . ' - Login';
if(isset($_COOKIE['LoginForm']))
    $model->setAttributes($_COOKIE['LoginForm']);

Yii::app()->clientScript->registerScript('loginFocus',
	'window.onload = function() { document.getElementById("LoginForm_username").focus(); }',
CClientScript::POS_HEAD);
?>
<div class="row-fluid">
    <div class="position-relative">
        <div id="login-box" class="login-box visible widget-box no-border">
            <div class="widget-body">
                <div class="widget-main">
                	<h4 class="header blue lighter bigger">
                        <i class="icon-coffee green"></i>
                        Please Enter Your Information
                    </h4>

                    <div class="space-6"></div>
<?php $form=$this->beginWidget('CActiveForm', array(
	// 'id'=>'login-form',
	'enableClientValidation'=>false,
	'enableAjaxValidation'=>false,
	'clientOptions'=>array(
		'validateOnSubmit'=>false,
	),
));
	?><!--<h2><?php echo Yii::t('app','Welcome to {appName}.',array('{appName}'=>Yii::app()->name)); ?></h2>-->
	<fieldset>
		<label>
			<span class="block input-icon input-icon-right">
				<?php echo $form->textField($model,'username',array('autofocus'=>'autofocus', 'class' => 'span12','placeholder'=>'Username')); ?>
				<i class="icon-user"></i>
			</span>
		</label>
		<label>
			<span class="block input-icon input-icon-right">
				<?php echo $form->passwordField($model,'password',array('class' => 'span12','placeholder' => 'Password')); ?>
				<i class="icon-lock"></i>
				<?php echo $form->error($model,'password',array('class' => 'alert alert-error')); ?>
			</span>
		</label>
		<div class="space"></div>
		<div class="clearfix">
			<label class="inline">
				<?php echo $form->checkBox($model,'rememberMe',array('value'=>'1','uncheckedValue'=>'0')); ?>
				<span class="lbl"> Remember Me</span>
				<?php echo $form->error($model,'rememberMe'); ?>
			</label>
			<button class="width-35 pull-right btn btn-small btn-primary">
				<?php echo CHtml::submitButton(Yii::t('app',''),array('class' => 'hidden')); ?>
				<i class="icon-key"></i>
				Login
			</button>
		</div>
		<?php if($model->useCaptcha && CCaptcha::checkRequirements()) { ?>
			<div class="row" style="margin-top:5px;">
				<?php
				echo '<div>';
				$this->widget('CCaptcha',array(
					'clickableImage'=>true,
					'showRefreshButton'=>false,
					'imageOptions'=>array(
						'style'=>'display:block;cursor:pointer;',
						'title'=>Yii::t('app','Click to get a new image')
					)
				)); echo '</div>';
				echo '<p class="hint">'.Yii::t('app','Please enter the letters in the image above.').'</p>';
				echo $form->textField($model,'verifyCode');
				?>
			</div>
		<?php } ?>
		
</fieldset>
<!--<div id="login-logo"></div>-->
<?php $this->endWidget(); ?>
					<div class="social-or-login center">
					    <span class="bigger-110">Or Login Using</span>
					</div>

					<div class="social-login center">
					    <!-- <a class="btn btn-primary">
					        <i class="icon-facebook"></i>
					    </a>

					    <a class="btn btn-info">
					        <i class="icon-twitter"></i>
					    </a>
					    <a class="btn btn-danger">
					        <i class="icon-google-plus"></i>
					    </a>
					     -->
					    <?php echo CHtml::link('<i class="icon-google-plus"></i>',
				(@$_SERVER['HTTPS'] == 'on' ? 'https://' : 'http://') . 
				((substr($_SERVER['HTTP_HOST'],0,4)=='www.')?substr($_SERVER['HTTP_HOST'],4):$_SERVER['HTTP_HOST']) . 
				$this->createUrl('/site/googleLogin'),array('class'=>'btn btn-danger')); ?>

					</div>
				</div> <!-- Widget Main -->
				<div class="toolbar clearfix">
	                <div>
	                    <a href="#" onclick="show_box('forgot-box'); return false;" class="forgot-password-link">
	                        <i class="icon-arrow-left"></i>
	                        I forgot my password
	                    </a>
	                </div>

	                <div>
	                    <a href="#" onclick="show_box('signup-box'); return false;" class="user-signup-link">
	                        I want to register
	                        <i class="icon-arrow-right"></i>
	                    </a>
	                </div>
	            </div>
			</div>
		</div><!-- Login Box -->
		<div id="forgot-box" class="forgot-box widget-box no-border">
            <div class="widget-body">
                <div class="widget-main">
                    <h4 class="header red lighter bigger">
                        <i class="icon-key"></i>
                        Retrieve Password
                    </h4>

                    <div class="space-6"></div>
                    <p>
                        Enter your email and to receive instructions
                    </p>

                    <form />
                    <fieldset>
                        <label>
                            <span class="block input-icon input-icon-right">
                                <input type="email" class="span12" placeholder="Email" />
                                <i class="icon-envelope"></i>
                            </span>
                        </label>

                        <div class="clearfix">
                            <button onclick="return false;" class="width-35 pull-right btn btn-small btn-danger">
                                <i class="icon-lightbulb"></i>
                                Send Me!
                            </button>
                        </div>
                    </fieldset>
                    </form>
                </div><!--/widget-main-->

                <div class="toolbar center">
                    <a href="#" onclick="show_box('login-box'); return false;" class="back-to-login-link">
                        Back to login
                        <i class="icon-arrow-right"></i>
                    </a>
                </div>
            </div><!--/widget-body-->
        </div><!--/forgot-box-->
        <div id="signup-box" class="signup-box widget-box no-border">
            <div class="widget-body">
                <div class="widget-main">
                    <h4 class="header green lighter bigger">
                        <i class="icon-group blue"></i>
                        New User Registration
                    </h4>

                    <div class="space-6"></div>
                    <p> Enter your details to begin: </p>

                    <form />
                    <fieldset>
                        <label>
                            <span class="block input-icon input-icon-right">
                                <input type="email" class="span12" placeholder="Email" />
                                <i class="icon-envelope"></i>
                            </span>
                        </label>

                        <label>
                            <span class="block input-icon input-icon-right">
                                <input type="text" class="span12" placeholder="Username" />
                                <i class="icon-user"></i>
                            </span>
                        </label>

                        <label>
                            <span class="block input-icon input-icon-right">
                                <input type="password" class="span12" placeholder="Password" />
                                <i class="icon-lock"></i>
                            </span>
                        </label>

                        <label>
                            <span class="block input-icon input-icon-right">
                                <input type="password" class="span12" placeholder="Repeat password" />
                                <i class="icon-retweet"></i>
                            </span>
                        </label>

                        <label>
                            <input type="checkbox" />
                            <span class="lbl">
                                I accept the
                                <a href="#">User Agreement</a>
                            </span>
                        </label>

                        <div class="space-24"></div>

                        <div class="clearfix">
                            <button type="reset" class="width-30 pull-left btn btn-small">
                                <i class="icon-refresh"></i>
                                Reset
                            </button>

                            <button onclick="return false;" class="width-65 pull-right btn btn-mini  btn-yellow">
                                Register
                                <i class="icon-arrow-right icon-on-right"></i>
                            </button>
                        </div>
                    </fieldset>
                    </form>
                </div>

                <div class="toolbar center">
                    <a href="#" onclick="show_box('login-box'); return false;" class="back-to-login-link">
                        <i class="icon-arrow-left"></i>
                        Back to login
                    </a>
                </div>
            </div><!--/widget-body-->
        </div><!--/signup-box-->
	</div>
</div>
<!-- 	<div class="row" id="login-links" style="margin-top:10px;text-align:center;">
		<?php echo CHtml::link('<i class="icon-google-plus"></i>',
				(@$_SERVER['HTTPS'] == 'on' ? 'https://' : 'http://') . 
				((substr($_SERVER['HTTP_HOST'],0,4)=='www.')?substr($_SERVER['HTTP_HOST'],4):$_SERVER['HTTP_HOST']) . 
				$this->createUrl('/site/googleLogin'),array('class'=>'btn btn-danger')); ?>
		<?php // echo CHtml::link('<img src="'.Yii::app()->baseUrl.'/images/mobile.png" id="mobile-icon" /> X2Touch Mobile',Yii::app()->getBaseUrl() . '/index.php/x2touch',array('class'=>'x2touch-link')); ?>
	</div> -->